﻿<controls:ChildWindow 
	x:Class="MVVMtutorialAdvanced.BookAuthors"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
	xmlns:MVVMSL="clr-namespace:Riba.MVVMSL;assembly=RibaMVVMSL"
	xmlns:sdk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
	Style="{StaticResource ChildWindowStyle}"
	Width="300" Height="200" Title="BookAuthors"
	DataContext="{Binding Source={StaticResource App_ViewModelLocator}, Converter={StaticResource App_ViewModelNameToViewModelConverter}, ConverterParameter=MVVMtutorialAdvanced.BookAuthors_VM}"
>
	<Grid Margin="2">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition />
			<RowDefinition Height="4" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>

		<MVVMSL:ViewEventHandlerControl />

		<sdk:DataGrid
			ItemsSource="{Binding EntityList}"
			SelectedItem="{Binding SelectedEntity, Mode=TwoWay}"
			AutoGenerateColumns="True"
			RowDetailsVisibilityMode="VisibleWhenSelected"
			IsReadOnly="True"
			Grid.Row="1"
		/>

		<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
			<Button
				x:Name="CancelButton" Content="Cancel"
				Click="CancelButton_Click"
				Width="60" Margin="0, 0, 2, 0"
			/>
			<Button
				x:Name="OkButton" Content="OK"
				Command="{Binding CommandOk, Mode=OneWay}"
				Width="60"
			/>
		</StackPanel>
	</Grid>
</controls:ChildWindow>